/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "total_register_course")
@NamedQueries({
		@NamedQuery(name = "TotalRegisterCourse.findAll", query = "SELECT t FROM TotalRegisterCourse t"),
		@NamedQuery(name = "TotalRegisterCourse.findById", query = "SELECT t FROM TotalRegisterCourse t WHERE t.id = :id"),
		@NamedQuery(name = "TotalRegisterCourse.findByStudentId", query = "SELECT t FROM TotalRegisterCourse t WHERE t.studentId = :studentId"),
		@NamedQuery(name = "TotalRegisterCourse.findBySemester", query = "SELECT t FROM TotalRegisterCourse t WHERE t.semester = :semester"),
		@NamedQuery(name = "TotalRegisterCourse.findByYearSemester", query = "SELECT t FROM TotalRegisterCourse t WHERE t.yearSemester = :yearSemester"),
		@NamedQuery(name = "TotalRegisterCourse.findByTotalUnit", query = "SELECT t FROM TotalRegisterCourse t WHERE t.totalUnit = :totalUnit"),
		@NamedQuery(name = "TotalRegisterCourse.findByTotalFee", query = "SELECT t FROM TotalRegisterCourse t WHERE t.totalFee = :totalFee"),
		@NamedQuery(name = "TotalRegisterCourse.findByHasPay", query = "SELECT t FROM TotalRegisterCourse t WHERE t.hasPay = :hasPay"),
		@NamedQuery(name = "TotalRegisterCourse.findByChargedFee", query = "SELECT t FROM TotalRegisterCourse t WHERE t.chargedFee = :chargedFee") })
public class TotalRegisterCourse extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TotalRegisterCourseSequence")
	@SequenceGenerator(name = "TotalRegisterCourseSequence", sequenceName = "seq_total_register_course", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "student_id")
	private String studentId;
	@Basic(optional = false)
	@Column(name = "semester")
	private int semester;
	@Basic(optional = false)
	@Column(name = "year_semester")
	private int yearSemester;
	@Column(name = "total_unit")
	private Integer totalUnit;
	// @Max(value=?) @Min(value=?)//if you know range of your decimal fields
	// consider using these annotations to enforce field validation
	@Column(name = "total_fee")
	private Float totalFee;
	@Column(name = "has_pay")
	private Boolean hasPay;
	@Column(name = "charged_fee")
	private Float chargedFee;

	public TotalRegisterCourse() {
	}

	public TotalRegisterCourse(Long id) {
		this.id = id;
	}

	public TotalRegisterCourse(Long id, String studentId, int semester,
			int yearSemester) {
		this.id = id;
		this.studentId = studentId;
		this.semester = semester;
		this.yearSemester = yearSemester;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	public int getSemester() {
		return semester;
	}

	public void setSemester(int semester) {
		this.semester = semester;
	}

	public int getYearSemester() {
		return yearSemester;
	}

	public void setYearSemester(int yearSemester) {
		this.yearSemester = yearSemester;
	}

	public Integer getTotalUnit() {
		return totalUnit;
	}

	public void setTotalUnit(Integer totalUnit) {
		this.totalUnit = totalUnit;
	}

	public Float getTotalFee() {
		return totalFee;
	}

	public void setTotalFee(Float totalFee) {
		this.totalFee = totalFee;
	}

	public Boolean getHasPay() {
		return hasPay;
	}

	public void setHasPay(Boolean hasPay) {
		this.hasPay = hasPay;
	}

	public Float getChargedFee() {
		return chargedFee;
	}

	public void setChargedFee(Float chargedFee) {
		this.chargedFee = chargedFee;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof TotalRegisterCourse)) {
			return false;
		}
		TotalRegisterCourse other = (TotalRegisterCourse) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.TotalRegisterCourse[ id=" + id + " ]";
	}

}
